// pages/category/cpns/z-menu/z-menu.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    categories:{
      type:Array,
      value:[]
    }
  },

  data: {
    currentIndex:0
  },

 
  methods: {
    onItemClick(e){
      console.log(e);
      //保存当前点击的index
      const currentIndex = e.currentTarget.dataset.index;
      this.setData({
        currentIndex
      })
      this.triggerEvent('menuclick',{currentIndex},{})

    }
  }
})
